using Wizard.UI;

namespace TestWizard
{
	public partial class CompletePage : ExternalWizardPage
	{
	    private readonly CreateUserContext _context;
	    private readonly string _completionText;

	    public CompletePage(CreateUserContext context)
		{
		    _context = context;

		    // This call is required by the Windows Form Designer.
			InitializeComponent();

            // Pulling the format string off the dialog here makes it easier to localize later.
            _completionText = completionLabel.Text;
		}

	    private void CompletePage_SetActive(object sender, System.ComponentModel.CancelEventArgs e)
		{
            completionLabel.Text = string.Format(_completionText, _context.UserName);

            // You're not allowed to go back. Where would you go back to?
			SetWizardButtons(WizardButtons.Finish);
		}
	}
}
